package com.d0325;

import java.time.LocalDate;
import java.time.LocalTime;

public class TestLocalDate {
    public static void main(String[] args) {
       /* LocalDate date1=LocalDate.now();
        System.out.println(date1);

        LocalDate date2=LocalDate.of(2021,5,21);
        System.out.println(date2);
        System.out.println(date2.getYear());
        System.out.println(date2.getMonth());

        String str="2022-09-12";
        LocalDate date3=LocalDate.parse(str);
        System.out.println(date3);*/
        LocalTime time1=LocalTime.now();
        System.out.println("time:"+time1);
        LocalTime time2=LocalTime.of(20,12,9);
        System.out.println("time2:"+time2);
        System.out.println("时:"+time2.getHour());
        String str="12:34:09";
        LocalTime time3=LocalTime.parse(str);
        System.out.println("time3"+time3);
    }
}
